package com.project.web.admin.service.core;


import com.project.model.core.Admin;
import com.project.web.admin.service.common.BaseService;

import java.util.List;
public interface AdminService extends BaseService<Admin, Long> {

    /**
     * 保存admin 、adminRole(关系)
     *
     * @param admin
     * @param roleIds
     */
    void saveAdminCascadeRole(Admin admin, Long[] roleIds);

    /**
     * 根据admin查询条件，查询带有级联关系的List<Admin>
     *
     * @param admin
     * @return
     */
    List<Admin> getAdminCascadeRole(Admin admin);

    /**
     * 根据Admin、roleIds进行级联更新
     *
     * @param admin
     * @param delRoleIds
     * @param saveRoleIds
     */
    void updateAdminCascadeRoles(Admin admin, List<Long> delRoleIds, Long[] saveRoleIds);

    /**
     * 根据adminId.roleIds进行级联删除
     *
     * @param adminId
     * @param delRoleIds
     */
    void delAdminCascadeRoles(Long adminId, List<Long> delRoleIds);

    /**
     * 查询数量判断是否重复
     *
     * @param admin
     * @return
     */
    Boolean getCountForOnly(Admin admin);

    /**
     * 登录查询list专用
     *
     * @param admin
     * @return
     */
    List<Admin> selectListForLogin(Admin admin);
}
